package io.dcloud.h527baaa6.activity;

import android.content.Context;
import android.content.Intent;

import com.github.chrisbanes.photoview.PhotoView;

import butterknife.BindView;
import io.dcloud.h527baaa6.R;
import io.dcloud.h527baaa6.base.BaseActivity;
import io.dcloud.h527baaa6.bean.XmlBean;
import io.dcloud.h527baaa6.utils.ImageLoaderUtil;

public class ImageActivity extends BaseActivity {

    @BindView(R.id.photo_view)
    PhotoView mPhotoView;
    private XmlBean.DataBean.ItemListBean mItemListBean;

    public static void startActivity(Context context, XmlBean.DataBean.ItemListBean bean) {
        Intent intent = new Intent(context, ImageActivity.class);
        intent.putExtra("data", bean);
        context.startActivity(intent);
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_image;
    }

    @Override
    protected int getTitleText() {
        return R.string.image_play;
    }

    @Override
    protected void initViewAndData() {
        mItemListBean = (XmlBean.DataBean.ItemListBean) getIntent().getSerializableExtra("data");
        mToobarTitleView.setTitleText(mItemListBean.getName());
        ImageLoaderUtil.LoadImage(this,mItemListBean.getContentdat(),mPhotoView);
    }


}
